<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>javascript测试</title>
<script type="text/javascript">
	function ln(str){
		return str + "\n";
	}
	
	function mul(x,y) {
		return Number(x) * Number(y);
	}
	
	function show_date() {
		date = new Date();
		return ln(date.toLocaleString()) + ln(date.toGMTString()) +
			ln(date.toString());
	}
	
	function show_array() {
		ary = new Array("one","two","three");
		return ary.join(" | ");
	}

	function check() {
	  var out = document.frm_ret.ret;
		out.innerHTML += ln(document.links[0].href);
		out.innerHTML += ln(document.lastModified);
		out.innerHTML += ln(document.frm_ret.length);
		x = document.frm_ret.txt_x.value;
		y = document.frm_ret.txt_y.value;
		out.innerHTML += ln(x + " x " + y + " = " + mul(x,y));
		s = new String("Hello World");
		out.innerHTML += ln(s.big());
		out.innerHTML += show_date();
		out.innerHTML += show_array();
	}
</script>
</head>
<body>
	<a href="#1">link 1</a>
	<a href="#2">link 2</a>
	
	<br />
	<form name="frm_ret">
		<label for="txt_x">x : </label>
		<input type="text" name="txt_x" size="5" />
		<label for="txt_y">y : </label>
		<input type="text" name="txt_y" size="5" />
		<textarea name="ret" id="ret" cols="50" rows="15"></textarea>
	</form>

	<br />
	<input type="button" onclick="check();" name="check" value="check" />
</body>
</html>